<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddColsToUsersTable extends Migration
{
  /**
   * Run the migrations.
   */
  public function up()
  {
    Schema::table('users', function (Blueprint $table) {
      $table->boolean('active')->default(true);
      $table->boolean('registered')->default(false);
      $table->timestamp('last_login_at')->nullable();
      $table->timestamp('last_logout_at')->nullable();
    });
  }

  /**
   * Reverse the migrations.
   */
  public function down()
  {
    Schema::table('users', function (Blueprint $table) {
      $table->dropColumn('last_logout_at');
      $table->dropColumn('last_login_at');
      $table->dropColumn('registered');
      $table->dropColumn('active');
    });
  }
}
